<?php

/**
 * This is the model class for table "d_pjb".
 *
 * The followings are the available columns in table 'd_pjb':
 * @property integer $ID
 * @property string $KDSATKER
 * @property string $NIP
 * @property string $NAMA
 * @property string $TGLAHIR
 * @property string $SEX
 * @property integer $ISTRI
 * @property integer $ANAK
 * @property string $M511311
 * @property string $M511323
 * @property string $M511331
 * @property string $M511332
 * @property string $M511333
 * @property string $M511334
 * @property string $M511336
 */
class DPjb extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return DPjb the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'd_pjb';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('ISTRI, ANAK', 'numerical', 'integerOnly'=>true),
			array('KDSATKER', 'length', 'max'=>6),
			array('NIP', 'length', 'max'=>9),
			array('NAMA', 'length', 'max'=>50),
			array('SEX', 'length', 'max'=>1),
			array('M511311, M511323, M511331, M511332, M511333, M511334, M511336', 'length', 'max'=>19),
			array('TGLAHIR', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('ID, KDSATKER, NIP, NAMA, TGLAHIR, SEX, ISTRI, ANAK, M511311, M511323, M511331, M511332, M511333, M511334, M511336', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'ID' => 'ID',
			'KDSATKER' => 'Kdsatker',
			'NIP' => 'Nip',
			'NAMA' => 'Nama',
			'TGLAHIR' => 'Tglahir',
			'SEX' => 'Sex',
			'ISTRI' => 'Istri',
			'ANAK' => 'Anak',
			'M511311' => 'M511311',
			'M511323' => 'M511323',
			'M511331' => 'M511331',
			'M511332' => 'M511332',
			'M511333' => 'M511333',
			'M511334' => 'M511334',
			'M511336' => 'M511336',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('ID',$this->ID);
		$criteria->compare('KDSATKER',$this->KDSATKER,true);
		$criteria->compare('NIP',$this->NIP,true);
		$criteria->compare('NAMA',$this->NAMA,true);
		$criteria->compare('TGLAHIR',$this->TGLAHIR,true);
		$criteria->compare('SEX',$this->SEX,true);
		$criteria->compare('ISTRI',$this->ISTRI);
		$criteria->compare('ANAK',$this->ANAK);
		$criteria->compare('M511311',$this->M511311,true);
		$criteria->compare('M511323',$this->M511323,true);
		$criteria->compare('M511331',$this->M511331,true);
		$criteria->compare('M511332',$this->M511332,true);
		$criteria->compare('M511333',$this->M511333,true);
		$criteria->compare('M511334',$this->M511334,true);
		$criteria->compare('M511336',$this->M511336,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}